﻿<UserControl x:Class="MojAddNewMovie.Control_AddNewMovie"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:c="clr-namespace:Converters"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="300">

    <UserControl.Resources>
        <c:ConvertThumbPathToImage x:Key="ConvertThumbPathToImage"/>
    </UserControl.Resources>

    <Grid x:Name="_grid">
        <Grid x:Name="_grid_controls">
            <TextBox x:Name="_txtBox_Search" Height="23" Margin="10,10,39,0" TextWrapping="Wrap" Text="Search..." VerticalAlignment="Top"/>
            <Button x:Name="_btn_search" Content="S" HorizontalAlignment="Right" Margin="0,10,10,0" VerticalAlignment="Top" Width="24" Height="23"/>
            <ListView x:Name="_listView" Margin="10,38,10,34" ScrollViewer.HorizontalScrollBarVisibility="Disabled" >
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <StackPanel Orientation="Vertical">
                            <Image x:Name="_listView_Image" Width="90" Height="140" Stretch="Fill"
                               Source="{Binding Cover, Converter={StaticResource ConvertThumbPathToImage}}" />
                            <TextBlock x:Name="_listView_Title" Width="90" TextWrapping="Wrap" Text="{Binding Title}" TextAlignment="Center" />
                            <TextBlock x:Name="_listView_Year" Width="90" TextWrapping="Wrap" Text="{Binding Year}" TextAlignment="Center"/>
                        </StackPanel>
                    </DataTemplate>
                </ListView.ItemTemplate>
                <ListView.ItemsPanel>
                    <ItemsPanelTemplate>
                        <WrapPanel Orientation="Horizontal"/>
                    </ItemsPanelTemplate>
                </ListView.ItemsPanel>
            </ListView>
            <Button x:Name="_btnSelect" Content="Add Movie" Margin="10,0,10,9" VerticalAlignment="Bottom"/>
        </Grid>
        <Grid x:Name="_grid_back">
            <ProgressBar x:Name="_proBar" Height="23" Margin="10,10,10,0" IsIndeterminate="True" VerticalAlignment="Top" />
        </Grid>
    </Grid>
</UserControl>
